package homework;

import java.util.Scanner;

public class NumericalSorting {
    /*
    * 7.输入3个数,按大小输出这3个数
    * （例如：用户输入的是：10  5  20  ，排序后为：5 10 20）
    * （备注：只能使用三个变量，而且只能使用if的嵌套）*/
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第1个数字");
        int a = sc.nextInt();
        System.out.println("请输入第2个数字");
        int b = sc.nextInt();
        System.out.println("请输入第3个数字");
        int c = sc.nextInt();

        if (a < b) {
            if (b < c && b > a){
                System.out.println(a + " " + b + " " + c);
            }else if (a < c && c < b) {
                System.out.println(a + " " + c + " " + b);
            }else if (c < a && a < b) {
                System.out.println(c + " " + a + " " + b);
            }
        }else {
            if (b < a && a < c){
                System.out.println(b + " " + a + " " + c);
            }else if (b < c && c < a) {
                System.out.println(b + " " + c + " " + a);
            }else if (c < b && b < a) {
                System.out.println(c + " " + b + " " + a);
            }
        }













//        if (a < b) {
//            if (b < c){
//                System.out.println(a + " " + b + " " + c);
//            }else if (b > c){
//                System.out.println(a + " " + c + " " + b);
//            }else if (a < b || a > c) {
//                System.out.println(c + " " + a + " "+ b);
//            }
//        }else{
//            if (a > c) {
//                System.out.println(b + " " + c + " " + a);
//            }else if(a < c) {
//                System.out.println(b + " " + a + " " + c);
//            }else if(b > c) {
//                System.out.println(c + " " + b + " " + a);
//            }
//
//        }



    }
}
